﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using FineUI;
using SDLITS.Model;
using SDLITS.Common;
using MySoft.Data;

namespace SDLITS.Web.LED
{
    public partial class LEDLogManage : CommonBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }
        }
        private void BindGrid()
        {
            ModelLoginUser user = Session["LoginUser"] as ModelLoginUser;
            Grid1.RecordCount = SDDbSession.Default.From<V_LogAuditUser>().Where(V_LogAuditUser._.CreateUserID==user.UserID).Count();
            List<V_LogAuditUser> items = SDDbSession.Default.From<V_LogAuditUser>().Where(V_LogAuditUser._.CreateUserID == user.UserID).Page(Grid1.PageSize, (Grid1.PageIndex + 1)).ToList();
            Grid1.DataSource = items;
            Grid1.DataBind();
        }

        protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
        {
            Grid1.PageIndex = e.NewPageIndex;
            BindGrid();
        }
        
        protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
        {
            
        }

        protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
        {
            
        }
    }
}
